package td0.Personnels;

public abstract class Personnel {

	private String nom;
	private String prenom;
	private int numSecu;
	private Departement departement;

	public Personnel(String nom, String prenom, int numSecu,
			Departement departement) {
		this.nom = nom;
		this.prenom = prenom;
		this.numSecu = numSecu;
		this.departement = departement;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((departement == null) ? 0 : departement.hashCode());
		result = prime * result + ((nom == null) ? 0 : nom.hashCode());
		result = prime * result + numSecu;
		result = prime * result + ((prenom == null) ? 0 : prenom.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Personnel other = (Personnel) obj;
		if (departement != other.departement)
			return false;
		if (nom == null) {
			if (other.nom != null)
				return false;
		} else if (!nom.equals(other.nom))
			return false;
		if (numSecu != other.numSecu)
			return false;
		if (prenom == null) {
			if (other.prenom != null)
				return false;
		} else if (!prenom.equals(other.prenom))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "Personnel [nom=" + nom + ", prenom=" + prenom + ", numSecu="
				+ numSecu + "]";
	}

	public String getNom() {
		return nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

	public String getPrenom() {
		return prenom;
	}

	public void setPrenom(String prenom) {
		this.prenom = prenom;
	}

	public Integer getNumSecu() {
		return numSecu;
	}

	public void setNumSecu(Integer numSecu) {
		this.numSecu = numSecu;
	}

}
